<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/9/23
  Time: 17:21
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>DouPHP 管理中心 - 网站管理员 </title>
    <meta name="Copyright" content="Douco Design."/>
    <link href="css/public.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script type="text/javascript" src="js/global.js"></script>
</head>
<body>
<div id="dcWrap">
    <div id="dcHead">
        <div id="head">
            <div class="logo"><a href="index.jsp"><img src="images/dclogo.gif" alt="logo"></a></div>
            <div class="nav">
                <ul>
                    <li class="M"><a href="JavaScript:void(0);" class="topAdd">新建</a>
                        <div class="drop mTopad"><a href="product.php?rec=add">商品</a> <a
                                href="article.php?rec=add">文章</a> <a href="nav.php?rec=add">自定义导航</a> <a
                                href="show.html">首页幻灯</a> <a href="page.php?rec=add">单页面</a> <a
                                href="manager.php?rec=add">管理员</a> <a href="link.html"></a></div>
                    </li>
                    <li><a href="../index.php" target="_blank">查看站点</a></li>
                    <li><a href="index.php?rec=clear_cache">清除缓存</a></li>
                    <li><a href="http://help.douco.com" target="_blank">帮助</a></li>
                    <li class="noRight"><a href="module.html">DouPHP+</a></li>
                </ul>
                <ul class="navRight">
                    <li class="M noLeft"><a href="JavaScript:void(0);">您好，${user.userName}</a>
                        <div class="drop mUser">
                            <a href="manager.php?rec=edit&id=1">编辑我的个人资料</a>
                            <a href="manager.php?rec=cloud_account">设置云账户</a>
                        </div>
                    </li>
                    <li class="noRight"><a href="exit">退出</a></li>
                </ul>
            </div>
        </div>
    </div>
    <!-- dcHead 结束 -->
    <div id="dcLeft">
        <div id="menu">
            <ul class="top">
                <li><a href="index.jsp"><i class="home"></i><em>管理首页</em></a></li>
            </ul>
            <ul>
                <li><a href="password.jsp"><i class="system"></i><em>修改密码</em></a></li>
                <li><a href="list.jsp"><i class="nav"></i><em>快递管理</em></a></li>

            </ul>
        </div>
    </div>
    <div id="dcMain">
        <!-- 当前位置 -->
        <div id="urHere">DouPHP 管理中心<b>></b><strong>修改密码</strong></div>
        <div id="manager" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
            <h3><a href="index.jsp" class="actionBtn">返回首页</a>修改密码</h3>
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <tr>
                    <td width="100" align="right">原始密码</td>
                    <td>
                        <input type="password" id="olePwd" onchange="check()" size="40" class="inpMain"/>
                        <div id="div1"></div>
                    </td>

                </tr>
                <tr>
                    <td width="100" align="right">新密码</td>
                    <td>
                        <input type="password" id="newPwd" size="40" class="inpMain"/>
                    </td>
                </tr>
                <tr>
                    <td align="right">确认密码</td>
                    <td>
                        <input onchange="checkPwd()" type="password" id="confirmPwd" size="40" class="inpMain"/>
                    </td>
                </tr>

                <tr>
                    <td></td>
                    <td>
                        <button class="btn" id="btn1">提交</button>
                        <%--                        <input type="submit" name="submit" class="btn" value="提交" />--%>
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <script type="text/javascript">
        function check() {
            $.ajax({
                url: "checkOldPwd",
                type: "post",
                data: "oldPwd=" + $("#olePwd").val(),
                success: function (msg) {
                    if (msg == 1) {
                        $("#div1").text("√").css("color", "green")
                        $("#btn1").prop("disabled", false)
                    } else {
                        $("#div1").text("×").css("color", "red")
                        $("#btn1").prop("disabled", true)
                    }
                }
            })
        }

        $("#btn1").click(function () {
            $.ajax({
                url: "updatePwd",
                type: "post",
                data: "newPwd=" + $("#confirmPwd").val(),
                success: function (msg) {
                    if (msg == 1) {
                        alert('修改成功')
                    } else {
                        alert('修改失败')
                    }
                }
            })
        })

        function checkPwd() {
            if ($("#newPwd").val() != $("#confirmPwd").val()) {
                alert('密码不一样，请重新输入')
                $("#btn1").prop("disabled", true)
            } else {
                $("#btn1").prop("disabled", false)
            }
        }
    </script>
    <div class="clear"></div>
    <div id="dcFooter">
        <div id="footer">
            <div class="line"></div>
            <ul>
                版权所有 © 2013-2015 漳州豆壳网络科技有限公司，并保留所有权利。
            </ul>
        </div>
    </div><!-- dcFooter 结束 -->
    <div class="clear"></div>
</div>
</body>
</html>
